{%include file="m.index.header.tpl.php"%}
<!--头部 end-->
<!--主体部分-->

<div class="container" style="margin-top:70px;">
    <div class="row" style="margin-top:10px;margin-bottom:20px;">
        <div class="col-sm-12 distance" >
            <div class="form-group">
                {%if $award_type==1%}
                <div class="text-center">
                     <div class="col-xs-6"><a href="index.php?a=award.studentsetlist&award_type=1" class="btn btn-primary">学生奖励行为</a></div>   
                     <div class="col-xs-6"> <a href="index.php?a=award.studentsetlist&award_type=2" class="btn btn-default">学生违规行为</a></div>
                </div>
                {%else%}
                <div class="text-center">
                <div class="col-xs-6"> <a href="index.php?a=award.studentsetlist&award_type=1" class="btn btn-default">学生奖励行为</a></div>
                <div class="col-xs-6"><a href="index.php?a=award.studentsetlist&award_type=2" class="btn btn-primary">学生违规行为</a></div>
                </div>
                {%/if%}

            </div>
        </div>
    </div>
    <div class="row" style="margin-right:10%;">
        <div  class="col-xs-sm  text-right" > {%if $award_type==1%}
            <a href="index.php?a=award.awardstudentadd" class="btn btn-success btn-sm" style="float:right; width:30%"> 新 增 </a>
            {%else%}
            <a href="index.php?a=award.punishstudentadd" class="btn btn-success btn-sm" style="float:right; width:30%""> 新 增 </a>
            {%/if%}</div>
    </div>
    <div class="row" style="margin-top:15px;margin-left:1px; margin-right:1px;">
        {%foreach from=$award_lists key=key item=value%}
        <table class="table table-striped table-bordered text-center"  id="middles">
            <tr>
                <td>{%$award_tname%}行为</td>
                <td>{%$value.award_title%}</td>
            </tr>
            <tr>
                <td>{%$award_tname%}学分</td>
                <td>{%$value.award_credit%}</td>
            </tr>
            <tr>
                <td>操作</td>
                <!--  <td ><a type="button" class="btn btn-warning  " href="superior_notice_select.html" >查看</a> -->
                <td><a type="button" class="btn btn-danger  " href="index.php?a=award.studentsetupdate&award_type={%$value.award_type%}&award_id={%$value.award_id%}" >修改</a></td>

                <!--   <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#myModal">转发</button></td>-->
            </tr>
        </table>
        {%/foreach%}
    </div>
</div>
<!--container  end-->

<!--主体部分  end-->
<!--底部-->
{%include file="m.index.footer.tpl.php"%}
<!--container  end-->

<!--底部end-->
<script src="mstatic/js/jquery.min.js" type="text/javascript"></script>
<script src="mstatic/js/bootstrap.min.js"  type="text/javascript"></script>
<script src="mstatic/js/jquery-ui.js"  type="text/javascript"></script><!--日历-->
<script type="text/javascript" src="mstatic/js/jquery.ztree.core-3.5.js"></script><!--树状图-->
<script type="text/javascript" src="mstatic/js/jquery.ztree.excheck-3.5.js"></script><!--树状图-->
<script type="text/javascript">
    var setting = {
        check: {
            enable: true,
        },
        data: {
            simpleData: {
                enable: true
            }
        }
    };
    var zNodes =[
        { id:1, pId:0, name:"初一级"},
        { id:11, pId:1, name:"初一1班",},
        { id:11, pId:1, name:"初一2班",},
        { id:11, pId:1, name:"初一3班",},
        { id:2, pId:0, name:"初二级"},
        { id:21, pId:2, name:"初二2班"},
        { id:21, pId:2, name:"初二2班"},
        { id:21, pId:2, name:"初二2班"},
        { id:21, pId:2, name:"初二2班"},
        { id:3, pId:0, name:"初三级"},
        { id:31, pId:3, name:"初三2班"},
        { id:31, pId:3, name:"初三2班"},
        { id:31, pId:3, name:"初三2班"},
        { id:31, pId:3, name:"初三2班"},
    ];
    var code;

    function setCheck1() {
        var zTree = $.fn.zTree.getZTreeObj("tree2"),
            py = $("#py").attr("checked")? "p":"",
            sy = $("#sy").attr("checked")? "s":"",
            pn = $("#pn").attr("checked")? "p":"",
            sn = $("#sn").attr("checked")? "s":"",
            type = { "Y":py + sy, "N":pn + sn};
        zTree.setting.check.chkboxType = type;
        showCode('setting.check.chkboxType = { "Y" : "' + type.Y + '", "N" : "' + type.N + '" };');
    }
    function showCode(str) {
        if (!code) code = $("#code");
        code.empty();
        code.append("<li>"+str+"</li>");
    }
    $(document).ready(function(){
        $.fn.zTree.init($("#tree2"), setting, zNodes);
        setCheck1();
        $("#py").bind("change", setCheck1);
        $("#sy").bind("change", setCheck1);
        $("#pn").bind("change", setCheck1);
        $("#sn").bind("change", setCheck1);
    });

    function c()
    {
        var delidID = "";
        var zTree = $.fn.zTree.getZTreeObj("treeDemo").getCheckedNodes(true);//获取所有选中状态的节点
        for (var i = 0; i < zTree.length; i++) {
            //delidID += zTree[i].id + ",";
            $("#hiddenBox").append('<input type="hidden" name="pid[]" value="'+zTree[i].id+'">');
        }
        var zTree = $.fn.zTree.getZTreeObj("tree2").getCheckedNodes(true);//获取所有选中状态的节点
        for (var i = 0; i < zTree.length; i++) {
            //delidID += zTree[i].id + ",";
            $("#hiddenBox").append('<input type="hidden" name="pid[]" value="'+zTree[i].id+'">');
        }
    }
</script>
<script type="text/javascript">
    var setting = {
        check: {
            enable: true,
        },
        data: {
            simpleData: {
                enable: true
            }
        }
    };
    var zNodes =[
        { id:1, pId:0, name:"初一级"},
        { id:11, pId:1, name:"初一1班",},
        { id:11, pId:1, name:"初一2班",},
        { id:11, pId:1, name:"初一3班",},
        { id:2, pId:0, name:"初二级"},
        { id:21, pId:2, name:"初二2班"},
        { id:21, pId:2, name:"初二2班"},
        { id:21, pId:2, name:"初二2班"},
        { id:21, pId:2, name:"初二2班"},
        { id:3, pId:0, name:"初三级"},
        { id:31, pId:3, name:"初三2班"},
        { id:31, pId:3, name:"初三2班"},
        { id:31, pId:3, name:"初三2班"},
        { id:31, pId:3, name:"初三2班"},
    ];
    var code;

    function setCheck() {
        var zTree = $.fn.zTree.getZTreeObj("treeDemo"),
            py = $("#py").attr("checked")? "p":"",
            sy = $("#sy").attr("checked")? "s":"",
            pn = $("#pn").attr("checked")? "p":"",
            sn = $("#sn").attr("checked")? "s":"",
            type = { "Y":py + sy, "N":pn + sn};
        zTree.setting.check.chkboxType = type;
        showCode('setting.check.chkboxType = { "Y" : "' + type.Y + '", "N" : "' + type.N + '" };');
    }
    function showCode(str) {
        if (!code) code = $("#code");
        code.empty();
        code.append("<li>"+str+"</li>");
    }
    $(document).ready(function(){
        $.fn.zTree.init($("#treeDemo"), setting, zNodes);
        setCheck();
        $("#py").bind("change", setCheck);
        $("#sy").bind("change", setCheck);
        $("#pn").bind("change", setCheck);
        $("#sn").bind("change", setCheck);
    });
</script>

<!--日历-->
<script>
    $(function() {
        $( "#start_time" ).datepicker({
            defaultDate: "+1w",
            changeMonth: true,
            changeYear: true,
            numberOfMonths:1,
            onClose: function( selectedDate ) {
                $( "#end_time" ).datepicker( "option", "minDate", selectedDate );
            }
        });
        $( "#end_time" ).datepicker({
            defaultDate: "+1w",
            changeMonth: true,
            changeYear: true,
            numberOfMonths:1,
            onClose: function( selectedDate ) {
                $( "#start_time" ).datepicker( "option", "maxDate", selectedDate );
            }
        });
    });
</script>
</body>
</html>
